package src.main.原型模式;

public class Son1 implements  Cloneable{
    // 这里需要实现Cloneable接口
    @Override
    protected Son1 clone() throws CloneNotSupportedException {
        return (Son1) super.clone();
    }

    public static void main(String[] args) {
        Son1 son1 = new Son1();
        try {
            Son1 son2 = son1.clone();
            System.out.println(son1 == son2); // 输出 false
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }    }
}
